package swing;

import javax.swing.*;
import java.awt.*;

public class TextTest {

    public static void main(String[] args) {
        int height, width;
        READ: {
            try {
                height = Integer.parseInt(args[0]);
                width = Integer.parseInt(args[1]);
                if (height > 0 && width > 0)
                    break READ;
            } catch (RuntimeException e) {
            }
            height = 0x20;
            width = 0x20;
        }
        JFrame frame = new JFrame();
        frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JPanel panel = new JPanel();

        GridBagLayout layout = new GridBagLayout();

        GridBagConstraints constraints = new GridBagConstraints();
        constraints.gridx = 0;
        constraints.gridy = 0;
        constraints.fill = GridBagConstraints.HORIZONTAL;
        layout.setConstraints(panel, constraints);
        JScrollPane pane = new JScrollPane(panel);

        frame.add(pane);

        frame.setVisible(true);
    }
}